//
//  RecordViewController.swift
//  KaMengApplication
//
//  Created by DUONIU_MAC on 2018/9/17.
//  Copyright © 2018年 DUONIU_MAC. All rights reserved.
//

import UIKit

class RecordViewController: KMViewController {
    
    init(title:String?) {
        super.init(nibName: nil, bundle: nil)
        
        self.title = title
    }
    
    required init?(coder aDecoder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    
    override func viewDidLoad() {
        super.viewDidLoad()

        
        let recordView = RecordView()
        recordView.recordDelegate = self
        self.view.addSubview(recordView)
        
        recordView.snp.makeConstraints { (make) in
            make.edges.equalToSuperview().inset(UIEdgeInsets.zero)
        }
    }

    override func didReceiveMemoryWarning() {
        super.didReceiveMemoryWarning()
        // Dispose of any resources that can be recreated.
    }
    

}

extension RecordViewController : RecordViewDelegate {
    
    //MARK: 选择记录类型
    func selectRecordType(title: String, index: Int) {
        
        switch index {
        case 0:
            let recordVC = RecordCardViewController.init(title: title)
            self.navigationController?.pushViewController(recordVC, animated: true)
        default:
            break
        }
    }
}
